#include <iostream>
#include <vector>
#include<io.h>
#include <string.h>
#include "public.h"
#include <ctime>
class stringbuffer :public string{

};
class Object{
public:
    string name;   // 盒子的长度
    double breadth;  // 盒子的宽度
    double height;   // 盒子的高度
public:
    Object( ){

    }
    Object(string name){
//        cout << "Object is being created "<<endl;
        this->name=name;
        this->height=100;
    }
    void show(){
        cout << "show(" << this->name <<"," << this->height <<")"<<endl;
    }
//   ~ Object(){
//        cout << "Object is being deleted "<<endl;
//    }
};
//派生类
class Dog : public Object {
    // bark() 函数
public:
    Dog(){
//        cout << "Dog is being created "<<endl;
    }
    Dog(string name){
//        cout << "Dog is being created "<<endl;
        this->name=name;
    }
    void show(){
        this->height=250;
       cout << "show(" << this->name <<"," << this->height <<")"<<endl;
    }
};
using namespace std;
int main(){
    vector<Object> vec;

    Object o1("Object");
    vec.push_back(o1);

    Dog o2("Dog");

    vec.push_back(o2);

    cout << vec.size() <<endl;

    vector<Object>::iterator v = vec.begin();
    while( v != vec.end()) {
        //cout << "value of v = " << (*v).name << endl;
        (*v).show();
        v++;
    }
    return 0;
}
